<?php $this->load->view('common/dpc-head');?>
<?php $this->load->view('common/dpc-header');?>
<h1 class="text-center" style="color:#F45435;text-shadow:2px 2px 2px #51245F;font-weight:400;">Category Name</h1>
<?php $this->load->view('common/dpc-top-search');?>
<div role="main">
            
            <div class="stripe-regular">
            
              <section class="company-box">
                <div class="row">
                  <div class="column">
                    <div class="wrapper-3 tertiary">
                      <div class="row collapse">
                        <div class="large-8 columns">
                          <div class="splitter-right">
                            <div class="inner">
                              <div class="row collapse">
                                <div class="large-4 columns">
                                  <figure>
                                  	<?php if($categoryArray[0]['parent_image_large']!=''){?>
                                  		<img src="<?php  echo $categoryArray[0]['parent_image_large']; ?>" alt="<?php echo $categoryArray[0]['parent_name']; ?>">
                                  	<?php }else{?>
                                    <img style="width:200px;height:110px;box-shadow: 0px 0px 4px #A049BB;border-radius:3px;" src="/public/images/all/200x110/<?php echo $categoryArray[0]['parent_url']; ?>.png" alt="<?php echo $categoryArray[0]['parent_name']; ?>">
                                    <?php }?>
                                  </figure>
                                </div>
                                <div class="large-8 columns">
                                  <div class="space-left">
                                    <h2 class="alt"><?php echo $categoryArray[0]['parent_name']; ?> Promo Codes</h2>
                                    <div class="text-content">
                                      <p>
                                        <?php echo $categoryArray[0]['parent_description']; ?>
                                      </p>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div class="large-4 columns">
                          <div class="splitter-left">
                            <div class="inner dark-bg">
                              <div class="row">
                                <div class="large-6 columns text-center">
                                  <h3>Total Category</h3>
                                </div>
                                <div class="large-6 columns">
                                  <div class="coupons-count">
                                    <p class="value primary"><?php echo count($childCatArray);?></p>
                                    <h4>categories</h4>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div style="clear:both;"></div>
                        <div style="width:100%;" id="child">
                         	<h5 style="padding:0 0 0 10px;">Top Categories</h5>
                            <ul>
                            	<?php foreach($childCatArray as $temp){?>
                            		<li><a href="/<?php echo $categoryArray[0]['parent_url'].'/'.$temp['category_url'];?>"><?php echo $temp['category_name'];?></a></li>
                            	<?php }?>
                            	<div style="clear:both;height:5px;">&nbsp;</div>
                           	</ul>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </section>
            
              <div class="row">                
                
                <div class="large-9 columns">
                  <div id="cpnDiv">                  
                  <div class="coupons-wrapper">
                    <div class="row">
                      <div class="large-8 columns">
                        <h2>Top <a><?php echo $categoryArray[0]['parent_name'];?></a> <span class="alt">Coupons</span></h2>
                      </div>
                      <div class="large-4 columns">
                      </div>
                    </div>
                    
                    <ul class="rr items-landscape">
                    <?php if(isset($catCouponArray) && !empty($catCouponArray)){ foreach($catCouponArray as $coupons){?>
                      <li class="wrapper-3">
                        <div class="row">
                          <div class="large-4 small-12 columns">
                            <figure><a href="/coupon.php/<?php echo $coupons['coupon_id']; ?>/<?php echo $coupons['store_id']; ?>" target="_blank" rel="nofollow">
                              <img src="
                              <?php if($coupons['coupon_image']!=''){ echo $coupons['coupon_image'];}else{ echo $coupons['store_image'];}?>
                              " alt="<?php echo $coupons['store_name'];?> promo codes" border="0" style="box-shadow:0px 0px 2px #A049BB;border-radius:3px;border:0;"></a>
                            </figure>
                          </div>
                          <div class="large-5 small-8 columns">
                            <div class="col-middle" id="sec">
                              <h2 class="alt"><a href="/coupon.php/<?php echo $coupons['coupon_id']; ?>/<?php echo $coupons['store_id']; ?>" target="_blank" rel="nofollow"><?php echo $coupons['coupon_name'];?></a> - <span style="font-weight:normal;color:#0099FF;font-size:14px;"><?php echo $coupons['store_name'];?></span></h2>
                                <?php echo $coupons['coupon_description'];?>
                            </div>
                          </div>
                          <div class="large-3 small-4 columns">
                            <div class="col-right">
                              <p class="value secondary"><?php if($coupons['coupon_off_in']=='Percentage'){ echo $coupons['coupon_off_by'].' %';}else{ echo 'Rs '.$coupons['coupon_off_by'];}?> <?php if($coupons['coupon_offer_only']=='Yes'){ echo 'offer';}else{ echo 'off';}?></p>
                              <h6><?php echo $coupons['diff'];?> days left</h6>
                              <a href="javascript:void(0);" rel="nofollow" class="input button red secondary responsive" id="showCoupon<?php echo $coupons['coupon_id']; ?>" onclick="showCouponCode('<?php echo $coupons['coupon_id']; ?>','<?php echo $coupons['store_id']; ?>')">Show Coupon</a>
                              <span class="input button border secondary responsive" id="couponCode<?php echo $coupons['coupon_id']; ?>" style="display:none;"><?php echo $coupons['coupon_code'];?></span>
                            </div>
                          </div>
                        </div>
                      </li>
                    <?php }}?>
                    
                    <?php if(isset($catOfferArray) && !empty($catOfferArray)){ foreach($catOfferArray as $offer){ ?>
                    <li class="wrapper-3">
                        <div class="row">
                          <div class="large-4 small-12 columns">
                            <figure><a href="/coupon.php/<?php echo $offer['coupon_id']; ?>/<?php echo $offer['store_id']; ?>" target="_blank" rel="nofollow">
                              <img src="
                              <?php if($offer['coupon_image']!=''){ echo $offer['coupon_image'];}else{ echo $offer['store_image'];}?>
                              " alt="<?php echo $offer['store_name'];?> offers" border="0" style="box-shadow:0px 0px 2px #A049BB;border-radius:3px;border:0;"></a>
                            </figure>
                          </div>
                          <div class="large-5 small-8 columns">
                            <div class="col-middle" id="sec">
                              <h2 class="alt"><a href="/coupon.php/<?php echo $offer['coupon_id']; ?>/<?php echo $offer['store_id']; ?>" target="_blank" rel="nofollow"><?php echo $offer['coupon_name'];?></a> - <span style="font-weight:normal;color:#0099FF;font-size:14px;"><?php echo $offer['store_name'];?></span></h2>
                                <?php echo $offer['coupon_description'];?>
                            </div>
                          </div>
                          <div class="large-3 small-4 columns">
                            <div class="col-right">
                              <p class="value secondary"><?php if($offer['coupon_off_in']=='Percentage'){ echo $offer['coupon_off_by'].' %';}else{ echo 'Rs '.$offer['coupon_off_by'];}?> <?php if($offer['coupon_offer_only']=='Yes'){ echo 'offer';}else{ echo 'off';}?></p>
                              <h6><?php echo $offer['diff'];?> days left</h6>
                              <a href="/coupon.php/<?php echo $offer['coupon_id']; ?>/<?php echo $offer['store_id']; ?>" target="_blank" rel="nofollow" class="input button blue secondary responsive">Learn more</a>
                            </div>
                          </div>
                        </div>
                      </li>
                      <?php }}?>
                    </ul>
                  </div>
                  <?php $count =ceil(count($couponCount)/5);  
                  if(count($couponCount)>5){?>
                  <ul class="rr pagination">
                  <?php if(isset($cur)){ if($cur=='1'){?>
                    <li><a style="background: #f0f0f0;color: #bebebe;">Previous</a></li>
                   <?php }else{?>
                   <li><a href="javascript:void(0);" onclick="moreCatCpn(<?php if(isset($prev)){ echo $prev;}?>, '<?php echo $categoryArray[0]['parent_url'];?>');">Previous</a></li>
                   <?php } for($i=0;$i<$count;$i++){?>
                    <li class="<?php if($cur==$i+1){ echo 'current';}?>"><a href="javascript:void(0);" onclick="moreCatCpn(<?php echo $i;?>, '<?php echo $categoryArray[0]['parent_url'];?>');" ><?php echo $i+1;?></a></li>
                   <?php }}?>
                   <?php if($cur==$count){?>
                    <li><a style="background: #f0f0f0;color: #bebebe;">Next</a></li>
                    <?php }else{?>
                    <li><a href="javascript:void(0);" onclick="moreCatCpn(<?php if(isset($next)){ echo $next;}?>, '<?php echo $categoryArray[0]['parent_url'];?>');">Next</a></li>
                    <?php }?>
                  </ul>
                  <?php }?>
                  </div>
                </div>
                
                <aside class="large-3 columns main-sidebar">
                <?php if(isset($catBanners) && !empty($catBanners)){?>
                  <div class="video-box small" style="margin:5px 0 10px 0;">
                    <a href="<?php echo $catBanners[0]['banner_link'];?>" target="_blank" rel="nofollow"><img src="<?php echo $catBanners[0]['banner_image'];?>" alt="<?php echo $catBanners[0]['banner_alt'];?>" border="0" /></a>
                  </div>
                <?php }?>
                  
                  <div class="info-box">
                    <h2 class="alt">Other Categories</h2>
                  </div>
                  
                  <div class="testimonials-box flexslider">
                    <ul class="rr">
                      <li>
                        <div class="testimonial">
                          <div class="wrapper-5" id="catList">
                          	<ul>
                          	<?php foreach($otherCat as $other){?>
                          		<li>
                          			<a href="/<?php echo $other['parent_url'];?>">
	                          			<div style="float:left;">
	                          				<img src="/public/images/all/50x50/<?php echo $other['parent_url'];?>-50.png" alt="<?php echo $other['parent_name']; ?>" />
	                          			</div>
	                          			<div style="float:left;margin-top:7px;"><?php echo $other['parent_name'];?></div>
	                          			<div style="clear:both;height:1px;"></div>
                          			</a>
                          		</li>
                          	<?php }?>
                          	</ul>
                          </div>
                        </div>
                      </li>
                    </ul>
                  </div>
                
                </aside>
              </div>
            </div>
            
          </div>
<?php $this->load->view('common/dpc-footer');?>